BotFighters, Autonomous Space Combat Arena

a real-time 2D space combat game, inspired by XPilot

2025-04-02

Let’s do real-time, arcade-like. project-based learning proposal with autonomous agents at the center, and still incorporating simulation, APIs, and visualization.

BotFighters !

Inspiration in very old school games

Project Summary

You will develop a real-time 2D space combat game, inspired by XPilot.

  • The game simulates physics-based movement (inertia, rotation, thrust), and pits autonomous agent-controlled ships against each other in a battle arena.
  • The simulation exposes an API to control agents.
  • Later phases involve writing bots that consume the API to compete, explore strategies, or apply, for instance, reinforcement learning.
  • Don’t worry, we will change stuff as we go.

Project Phases

  • Phase 1: Game Simulation Engine + API (Weeks 1–3)
  • Phase 2: External Agent Development (Weeks 3–5)
  • Phase 3: Enhancements & Research (Weeks 5–)

Phase 1: gamesim

  • Game Simulation Engine + API (Weeks 1–3)
  • Goal: Create the game world, ship dynamics, and expose APIs.

Phase 1 Components

  • Physics engine: Simulate ship movement, rotation, thrust, collisions
  • Game world: 2D arena with obstacles, walls, and pickups (ammo, health)
  • Game objects: Ships, bullets, mines, shields, etc.
  • Sensors: API exposes data like:
    • Radar scan (entities in radius)
    • Current velocity/angle
    • Health, ammo, cooldown timers

Phase 1 Components (2)

  • Actuators via API:
    • rotate(angle), thrust(force), fire(), dropMine(), activateShield()
  • Real-time or tick-based update loop
  • REST API:
    • Agents send commands, receive sensor updates each tick
  • Visualization:
    • Real-time 2D graphics using pygame or other packages
    • Show ships, effects, health bars, and others

Phase 2: agents

  • External Agent Development (Weeks 3–5)
  • Goal: Write agents that interact with the API to control ships.

Phase 2: agents

Bot Capabilities:

  • Rule-based agents (if enemy is near → fire)
  • some physics
  • Pathfinding & obstacle avoidance
  • Strategy switching (aggressive vs evasive)
  • Teams: cooperative strategies (advanced)

Possibilities:

  • Each student writes their own bot and enters a battle royale
  • Scoreboards and tournaments via automated match runner

Phase 3:

  • Enhancements & Research (Weeks 5–)
  • Goal: Make the game deeper, smarter, or more beautiful.

Possible Extensions:

  • Machine learning:
    • Train bots using RL (e.g., Q-learning, PPO)
  • Complex game features:
    • Fog of war
    • Powerups, hazards (black holes, laser turrets)
  • Network multiplayer mode
  • Replay system for games + analytics
  • Scientific twist: Use the game to study swarm behavior, emergent tactics

Suggested Tech Stack

  • Python for game engine:
    • pygame real time looping
    • pymunk Pymunk is a 2D physics engine written in Python, binding Chipmunk C physics library
    • Arcade Modern alternative to pygame. Better suited for structured games with tile maps, platforms, and better performance.
    • FastAPI you know this one
    • turn-based or realtime (consider learning asyncio)
  • REST API
  • GitHub for code collaboration
  • Optional: Web front-end

pygame

arcade

pymunk

Learning Objectives

  • Code python within a team context
  • GitHub workflows: branching, collaboration, PRs
  • Real-time simulation & game loop structure
  • REST/WebSocket API design
  • Multi-agent systems and sensor/actuator patterns
  • Game physics & visualization
  • AI programming & strategy development
  • Experimentation and data analysis (especially in ML or tournament phases)

Questions